package com.yeyks.consumer.dal.dao;

import com.yeyks.common.dto.RechargeRecordDTO;
import com.yeyks.common.param.RechargeRecordQueryParam;
import com.yeyks.consumer.dal.domain.RechargeRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 充值记录表 Mapper 接口
 * </p>
 *
 * @author yun
 * @since 2019-06-25
 */
public interface RechargeRecordMapper extends BaseMapper<RechargeRecord> {


    RechargeRecord selectOrderByOrderNo(String orderNo);

    Integer updateByOrderNoAndStatus(@Param("orderNo") String orderNo, @Param("status") int status);

    Integer selectCountByInviteId(@Param("inviteId") String inviteId);

    RechargeRecord selectByUserId(@Param("userId") Integer userId);

    RechargeRecord selectUserId(@Param("userId") Integer userId, @Param("status") Integer status, @Param("type") Integer type);

    /**
     * 分页查询
     * @param param
     * @return
     */
    List<RechargeRecordDTO> queryByParam(@Param("param") RechargeRecordQueryParam param);

    /**
     * 充值记录的 发票ID 置为null
     * @param id
     */
    void updateInvoiceIsNull(@Param("id") Long id);
}
